package com.eschool.beans;

import java.io.Serializable;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

import com.eschool.beans.datamodels.TimetableDataModel;
import com.eschool.model.ScheduleSlot;
import com.eschool.service.TimeTableService;
import com.eschool.service.impl.TimeTableServiceImpl;

@ManagedBean(name="viewTimetable")
@ViewScoped
public class ViewTimetableBean implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5014066606470163929L;

	List<ScheduleSlot> timetable;
	
	TimetableDataModel timetableModel;
	
	TimeTableService service = new TimeTableServiceImpl();
	
	public ViewTimetableBean() {
		
		timetable = service.getTimetable();
		
		timetableModel = new TimetableDataModel(timetable);
		
	}

	public TimetableDataModel getTimetableModel() {
		return timetableModel;
	}

	public void setTimetableModel(TimetableDataModel timetableModel) {
		this.timetableModel = timetableModel;
	}

	public List<ScheduleSlot> getTimetable() {
		return timetable;
	}

	public void setTimetable(List<ScheduleSlot> timetable) {
		this.timetable = timetable;
	}
}
